﻿package mortal.game.resource.tableConfig
{
    import Message.DB.Tables.*;
    import com.gengine.resource.*;
    import flash.utils.*;
    import mortal.game.view.common.*;

    public class EscortColorConfig extends Object
    {
        private var _dic:Dictionary;
        private static var _instance:EscortColorConfig;

        public function EscortColorConfig()
        {
            this._dic = new Dictionary();
            this.init();
            return;
        }// end function

        private function init() : void
        {
            var _loc_2:Object = null;
            var _loc_3:TEscortColor = null;
            this._dic = new Dictionary();
            var _loc_1:* = ConfigManager.instance.getJSONByFileName("t_escort_color.json");
            for each (_loc_2 in _loc_1)
            {
                
                _loc_3 = new TEscortColor();
                ClassTypesUtil.copyValue(_loc_3, _loc_2);
                this._dic[_loc_3.color] = _loc_3;
            }
            return;
        }// end function

        public function getItemByColor(param1:int) : TEscortColor
        {
            return this._dic[param1];
        }// end function

        public function get allColorData() : Array
        {
            var _loc_1:Array = [];
            var _loc_2:int = 0;
            while (_loc_2 < 5)
            {
                
                _loc_1.push(this.getItemByColor(_loc_2));
                _loc_2++;
            }
            return _loc_1;
        }// end function

        public static function get instance() : EscortColorConfig
        {
            if (!_instance)
            {
                _instance = new EscortColorConfig;
            }
            return _instance;
        }// end function

    }
}
